import java.math.BigDecimal;
public class TrainShareTicket implements IShareTicket {

    private String from;
    private String to;

    private String seatType = "站票";

    public TrainShareTicket(String from, String to) {
        this.from = from;
        this.to = to;
    }

    public void setSeat(String seatType) {
        this.seatType = seatType;
    }

    public void info() {
        System.out.println(from + "->" + to + ":" + seatType + this.getPrice(seatType));
    }

    private BigDecimal getPrice(String seatType) {

        BigDecimal value = null;

        switch(seatType) {
            case "硬座":
                value = new BigDecimal("100");
                break;
            case "硬卧":
                value = new BigDecimal("200");
                break;
            default:
                value = new BigDecimal("50");
        }

        return value;
    }
}